import fetch from 'node-fetch';

let data = await fetch("https://leetcode-cn.com/graphql/", {
  "headers": {
    "accept": "*/*",
    "accept-language": "en-US",
    "content-type": "application/json",
    "sec-ch-ua": "\"Chromium\";v=\"94\", \"Google Chrome\";v=\"94\", \";Not A Brand\";v=\"99\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Linux\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "x-csrftoken": "QiFVneUp6S4MuUGjRqqIwOHG4HDeYhEMKpE02y914CvbPdQ2UcQsaKVr2E04AI2t",
    "x-definition-name": "recentSubmissions",
    "x-operation-name": "recentSubmissions",
    "x-timezone": "Asia/Shanghai",
    "cookie": "aliyungf_tc=e4d0333f8a42756be4b91863ec0d6d8558902c444369eb346eecbb0abae305c7; csrftoken=QiFVneUp6S4MuUGjRqqIwOHG4HDeYhEMKpE02y914CvbPdQ2UcQsaKVr2E04AI2t; __auc=f614ec4417c262984a279904adc; Hm_lvt_fa218a3ff7179639febdb15e372f411c=1632727828; gr_user_id=d25c8abc-ce07-4e54-bf1c-10f322b12016; _ga=GA1.2.137702550.1632727828; _gid=GA1.2.33147434.1632727828; __asc=9dead01a17c2666e23ed2052f35; Hm_lpvt_fa218a3ff7179639febdb15e372f411c=1632731850; a2873925c34ecbd2_gr_session_id=e3e55537-4bde-41d7-85ca-9404db903755; a2873925c34ecbd2_gr_session_id_e3e55537-4bde-41d7-85ca-9404db903755=true"
  },
  "referrer": "https://leetcode-cn.com/u/ben-bo-er-ba-17/",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": "{\"operationName\":\"recentSubmissions\",\"variables\":{\"userSlug\":\"ben-bo-er-ba-17\"},\"query\":\"query recentSubmissions($userSlug: String!) {\\n  recentSubmissions(userSlug: $userSlug) {\\n    status\\n    lang\\n    source {\\n      sourceType\\n      ... on SubmissionSrcLeetbookNode {\\n        slug\\n        title\\n        pageId\\n        __typename\\n      }\\n      __typename\\n    }\\n    question {\\n      questionFrontendId\\n      title\\n      translatedTitle\\n      titleSlug\\n      __typename\\n    }\\n    submitTime\\n    __typename\\n  }\\n}\\n\"}",
  "method": "POST",
  "mode": "cors"
}).then((f) => f.json());

console.log(data)

fetch("https://leetcode-cn.com/graphql/", {
  "headers": {
    "accept": "*/*",
    "accept-language": "en-US",
    "content-type": "application/json",
    "sec-ch-ua": "\"Chromium\";v=\"94\", \"Google Chrome\";v=\"94\", \";Not A Brand\";v=\"99\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Linux\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "x-definition-name": "userProfilePublicProfile",
    "x-operation-name": "userPublicProfile",
    "x-timezone": "Asia/Shanghai",
  },
  "referrer": "https://leetcode-cn.com/u/zenghao/",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": "{\"operationName\":\"userPublicProfile\",\"variables\":{\"userSlug\":\"zenghao\"},\"query\":\"query userPublicProfile($userSlug: String!) {\\n  userProfilePublicProfile(userSlug: $userSlug) {\\n    username\\n    haveFollowed\\n    siteRanking\\n    profile {\\n      userSlug\\n      realName\\n      aboutMe\\n      userAvatar\\n      location\\n      gender\\n      websites\\n      skillTags\\n      contestCount\\n      asciiCode\\n      medals {\\n        name\\n        year\\n        month\\n        category\\n        __typename\\n      }\\n      ranking {\\n        rating\\n        ranking\\n        currentLocalRanking\\n        currentGlobalRanking\\n        currentRating\\n        ratingProgress\\n        totalLocalUsers\\n        totalGlobalUsers\\n        __typename\\n      }\\n      skillSet {\\n        langLevels {\\n          langName\\n          langVerboseName\\n          level\\n          __typename\\n        }\\n        topics {\\n          slug\\n          name\\n          translatedName\\n          __typename\\n        }\\n        topicAreaScores {\\n          score\\n          topicArea {\\n            name\\n            slug\\n            __typename\\n          }\\n          __typename\\n        }\\n        __typename\\n      }\\n      socialAccounts {\\n        provider\\n        profileUrl\\n        __typename\\n      }\\n      __typename\\n    }\\n    educationRecordList {\\n      unverifiedOrganizationName\\n      __typename\\n    }\\n    occupationRecordList {\\n      unverifiedOrganizationName\\n      jobTitle\\n      __typename\\n    }\\n    submissionProgress {\\n      totalSubmissions\\n      waSubmissions\\n      acSubmissions\\n      reSubmissions\\n      otherSubmissions\\n      acTotal\\n      questionTotal\\n      __typename\\n    }\\n    __typename\\n  }\\n}\\n\"}",
  "method": "POST",
  "mode": "cors"
}).then((f) => f.json()).then((j) => console.log(j.data.userProfilePublicProfile.profile.userAvatar))
